/**
 * All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
 * 
 * PmTaskLogServiceAuto 任务工作日志
 * 
 * 修改纪录 2020-05-15 版本：1.0 wushenghong 创建。
 * @version 版本：1.0
 * @author 作者：wushenghong 创建日期：2020-05-15
 */

package com.topscomm.pm.service.impl.auto;

import java.util.Map;

import javax.annotation.Resource;

import com.topscomm.basic.IBasicDao;
import com.topscomm.pm.PmService;
import com.topscomm.pm.dao.IPmTaskLogDao;
import com.topscomm.pm.pojo.PmTaskLogEntity;
import com.topscomm.tap.common.DatacodeCache;

public class PmTaskLogServiceAuto extends PmService<PmTaskLogEntity, IPmTaskLogDao>
{

    /**
     * @author: wushenghong
     * @date: 2020-05-15
     * @param mapRow
     * @description:设置字段显示值
     * @modify:
     */
    @Override
    public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache)
    {
	String temp;
	if (mapRow.get("projectid") != null)
	{
	    temp = mapRow.get("projectid").toString();
	    mapRow.put("dispprojectid", datacodeCache.getValueDynamic("PmProject", temp, "id", "name"));
	    mapRow.put("projectcode", datacodeCache.getValueDynamic("PmProject", temp, "id", "code"));
	}
	// if (mapRow.get("name") != null) {
	// temp = mapRow.get("name").toString();
	// mapRow.put("dispname", datacodeCache.getValueDynamic("PmTask", temp,
	// "id", "name"));
	// }
	if (mapRow.get("type") != null)
	{
	    temp = mapRow.get("type").toString();
	    mapRow.put("disptype", datacodeCache.getValueDynamic("PmTaskType", temp, "code", "name"));
	}

	if (mapRow.get("logtype") != null)
	{
		temp = mapRow.get("logtype").toString();
		mapRow.put("displogtype", datacodeCache.getValueDynamic("PmLogType", temp, "code", "name"));
	}

	if (mapRow.get("istaskleader") != null)
	{
	    temp = mapRow.get("istaskleader").toString();
	    mapRow.put("dispistaskleader", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
	}
	if (mapRow.get("ispm") != null)
	{
	    temp = mapRow.get("ispm").toString();
	    mapRow.put("dispispm", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
	}
	if (mapRow.get("flowid") != null)
	{
	    temp = mapRow.get("flowid").toString();
	    mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_PmTaskLog", temp, "id", "name"));
	}
	if (mapRow.get("state") != null)
	{
	    temp = mapRow.get("state").toString();
	    mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
	}
	if (mapRow.get("enabled") != null)
	{
	    temp = mapRow.get("enabled").toString();
	    mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
	}
    }

    @Override
    @Resource(name = "pmTaskLogDao")
    public void setDao(IBasicDao<PmTaskLogEntity> dao)
    {
	super.setDao(dao);
    }
}
